{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "from glob import glob\n",
    "from tqdm import tqdm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "father_path = r'E:\\\23研赛\\建模2023\\建模2023\\2023年中国研究生数学建模竞赛赛题\\E题\\E题\\数据\\竞赛发布数据'\n",
    "data_path = sorted(glob(os.path.join(father_path, '*.xlsx')))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['E:\\\\\\\23研赛\\\\建模2023\\\\建模2023\\\\2023年中国研究生数学建模竞赛赛题\\\\E题\\\\E题\\\\数据\\\\竞赛发布数据\\\\表1-患者列表及临床信息.xlsx',\n",
       " 'E:\\\\\\\23研赛\\\\建模2023\\\\建模2023\\\\2023年中国研究生数学建模竞赛赛题\\\\E题\\\\E题\\\\数据\\\\竞赛发布数据\\\\表2-患者影像信息血肿及水肿的体积及位置.xlsx',\n",
       " 'E:\\\\\\\23研赛\\\\建模2023\\\\建模2023\\\\2023年中国研究生数学建模竞赛赛题\\\\E题\\\\E题\\\\数据\\\\竞赛发布数据\\\\表3-患者影像信息血肿及水肿的形状及灰度分布.xlsx',\n",
       " 'E:\\\\\\\23研赛\\\\建模2023\\\\建模2023\\\\2023年中国研究生数学建模竞赛赛题\\\\E题\\\\E题\\\\数据\\\\竞赛发布数据\\\\表4-答案文件.xlsx',\n",
       " 'E:\\\\\\\23研赛\\\\建模2023\\\\建模2023\\\\2023年中国研究生数学建模竞赛赛题\\\\E题\\\\E题\\\\数据\\\\竞赛发布数据\\\\附表1-检索表格-流水号vs时间.xlsx']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "temp_data = []\n",
    "for file in data_path:\n",
    "    temp_data.append(pd.read_excel(file))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>90天mRS</th>\n",
       "      <th>数据集划分</th>\n",
       "      <th>入院首次影像检查流水号</th>\n",
       "      <th>年龄</th>\n",
       "      <th>性别</th>\n",
       "      <th>脑出血前mRS评分</th>\n",
       "      <th>高血压病史</th>\n",
       "      <th>卒中病史</th>\n",
       "      <th>糖尿病史</th>\n",
       "      <th>...</th>\n",
       "      <th>饮酒史</th>\n",
       "      <th>发病到首次影像检查时间间隔</th>\n",
       "      <th>血压</th>\n",
       "      <th>脑室引流</th>\n",
       "      <th>止血治疗</th>\n",
       "      <th>降颅压治疗</th>\n",
       "      <th>降压治疗</th>\n",
       "      <th>镇静、镇痛治疗</th>\n",
       "      <th>止吐护胃</th>\n",
       "      <th>营养神经</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>sub027</td>\n",
       "      <td>6.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20170206000071</td>\n",
       "      <td>63</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>166/74</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>sub066</td>\n",
       "      <td>6.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20181208000909</td>\n",
       "      <td>85</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>148/76</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>sub069</td>\n",
       "      <td>6.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20180619001505</td>\n",
       "      <td>67</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>168/82</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>sub077</td>\n",
       "      <td>6.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20180503002304</td>\n",
       "      <td>83</td>\n",
       "      <td>女</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>150/81</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>sub076</td>\n",
       "      <td>5.0</td>\n",
       "      <td>训练</td>\n",
       "      <td>20180619002401</td>\n",
       "      <td>76</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1.5</td>\n",
       "      <td>177/100</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>155</th>\n",
       "      <td>sub156</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20200306000927</td>\n",
       "      <td>87</td>\n",
       "      <td>女</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>5.5</td>\n",
       "      <td>202/100</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>sub157</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20201009003102</td>\n",
       "      <td>52</td>\n",
       "      <td>男</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>180/110</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>157</th>\n",
       "      <td>sub158</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20200410001952</td>\n",
       "      <td>57</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>2.8</td>\n",
       "      <td>233/135</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>sub159</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20200218000582</td>\n",
       "      <td>47</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>183/122</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>sub160</td>\n",
       "      <td>NaN</td>\n",
       "      <td>测试2</td>\n",
       "      <td>20200821002584</td>\n",
       "      <td>80</td>\n",
       "      <td>女</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>208/95</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>160 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Unnamed: 0  90天mRS 数据集划分     入院首次影像检查流水号  年龄 性别  脑出血前mRS评分  高血压病史  卒中病史  \\\n",
       "26      sub027     6.0    训练  20170206000071  63  男          0      1     1   \n",
       "65      sub066     6.0    训练  20181208000909  85  男          0      1     0   \n",
       "68      sub069     6.0    训练  20180619001505  67  男          0      1     1   \n",
       "76      sub077     6.0    训练  20180503002304  83  女          0      1     0   \n",
       "75      sub076     5.0    训练  20180619002401  76  男          0      1     0   \n",
       "..         ...     ...   ...             ...  .. ..        ...    ...   ...   \n",
       "155     sub156     NaN   测试2  20200306000927  87  女          0      1     0   \n",
       "156     sub157     NaN   测试2  20201009003102  52  男          2      1     1   \n",
       "157     sub158     NaN   测试2  20200410001952  57  男          0      1     0   \n",
       "158     sub159     NaN   测试2  20200218000582  47  男          0      1     0   \n",
       "159     sub160     NaN   测试2  20200821002584  80  女          0      1     0   \n",
       "\n",
       "     糖尿病史  ...  饮酒史  发病到首次影像检查时间间隔       血压  脑室引流  止血治疗 降颅压治疗  降压治疗  镇静、镇痛治疗  \\\n",
       "26      1  ...    0            3.0   166/74     0     1     1     1        1   \n",
       "65      0  ...    0            8.0   148/76     0     1     1     1        1   \n",
       "68      0  ...    0            2.0   168/82     0     0     1     1        1   \n",
       "76      0  ...    0            2.0   150/81     0     1     1     1        1   \n",
       "75      1  ...    0            1.5  177/100     0     1     1     1        1   \n",
       "..    ...  ...  ...            ...      ...   ...   ...   ...   ...      ...   \n",
       "155     0  ...    0            5.5  202/100     0     1     1     1        0   \n",
       "156     0  ...    0            0.5  180/110     1     0     1     1        1   \n",
       "157     0  ...    0            2.8  233/135     0     1     1     1        1   \n",
       "158     0  ...    1            3.0  183/122     0     1     1     1        1   \n",
       "159     1  ...    0            4.0   208/95     1     1     1     1        1   \n",
       "\n",
       "     止吐护胃  营养神经  \n",
       "26      1     1  \n",
       "65      1     1  \n",
       "68      1     1  \n",
       "76      1     1  \n",
       "75      1     1  \n",
       "..    ...   ...  \n",
       "155     1     1  \n",
       "156     1     1  \n",
       "157     1     1  \n",
       "158     1     1  \n",
       "159     1     1  \n",
       "\n",
       "[160 rows x 23 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_data[0].sort_values(by='90天mRS',ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>首次检查流水号</th>\n",
       "      <th>HM_volume</th>\n",
       "      <th>HM_ACA_R_Ratio</th>\n",
       "      <th>HM_MCA_R_Ratio</th>\n",
       "      <th>HM_PCA_R_Ratio</th>\n",
       "      <th>HM_Pons_Medulla_R_Ratio</th>\n",
       "      <th>HM_Cerebellum_R_Ratio</th>\n",
       "      <th>HM_ACA_L_Ratio</th>\n",
       "      <th>HM_MCA_L_Ratio</th>\n",
       "      <th>...</th>\n",
       "      <th>ED_ACA_R_Ratio.8</th>\n",
       "      <th>ED_MCA_R_Ratio.8</th>\n",
       "      <th>ED_PCA_R_Ratio.8</th>\n",
       "      <th>ED_Pons_Medulla_R_Ratio.8</th>\n",
       "      <th>ED_Cerebellum_R_Ratio.8</th>\n",
       "      <th>ED_ACA_L_Ratio.8</th>\n",
       "      <th>ED_MCA_L_Ratio.8</th>\n",
       "      <th>ED_PCA_L_Ratio.8</th>\n",
       "      <th>ED_Pons_Medulla_L_Ratio.8</th>\n",
       "      <th>ED_Cerebellum_L_Ratio.8</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161212002136</td>\n",
       "      <td>69714</td>\n",
       "      <td>0.000258</td>\n",
       "      <td>0.877112</td>\n",
       "      <td>0.120148</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>sub002</td>\n",
       "      <td>20160406002131</td>\n",
       "      <td>47500</td>\n",
       "      <td>0.496000</td>\n",
       "      <td>0.180779</td>\n",
       "      <td>0.302316</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.003032</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>sub003</td>\n",
       "      <td>20160413000006</td>\n",
       "      <td>86396</td>\n",
       "      <td>0.053718</td>\n",
       "      <td>0.829078</td>\n",
       "      <td>0.099681</td>\n",
       "      <td>0.000197</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>sub004</td>\n",
       "      <td>20161215001667</td>\n",
       "      <td>45498</td>\n",
       "      <td>0.002242</td>\n",
       "      <td>0.002198</td>\n",
       "      <td>0.029100</td>\n",
       "      <td>0.000374</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.163458</td>\n",
       "      <td>0.313618</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>sub005</td>\n",
       "      <td>20161222000978</td>\n",
       "      <td>14832</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.001146</td>\n",
       "      <td>0.000337</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000202</td>\n",
       "      <td>0.413363</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>155</th>\n",
       "      <td>sub156</td>\n",
       "      <td>20200306000927</td>\n",
       "      <td>32559</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.033754</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.038545</td>\n",
       "      <td>0.922049</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>156</th>\n",
       "      <td>sub157</td>\n",
       "      <td>20201009003102</td>\n",
       "      <td>18150</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.997410</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>157</th>\n",
       "      <td>sub158</td>\n",
       "      <td>20200410001952</td>\n",
       "      <td>27969</td>\n",
       "      <td>0.002682</td>\n",
       "      <td>0.937359</td>\n",
       "      <td>0.059959</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>158</th>\n",
       "      <td>sub159</td>\n",
       "      <td>20200218000582</td>\n",
       "      <td>53154</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.004572</td>\n",
       "      <td>0.857678</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>159</th>\n",
       "      <td>sub160</td>\n",
       "      <td>20200821002584</td>\n",
       "      <td>49019</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.907505</td>\n",
       "      <td>0.092372</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>160 rows × 208 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         ID         首次检查流水号  HM_volume  HM_ACA_R_Ratio  HM_MCA_R_Ratio  \\\n",
       "0    sub001  20161212002136      69714        0.000258        0.877112   \n",
       "1    sub002  20160406002131      47500        0.496000        0.180779   \n",
       "2    sub003  20160413000006      86396        0.053718        0.829078   \n",
       "3    sub004  20161215001667      45498        0.002242        0.002198   \n",
       "4    sub005  20161222000978      14832        0.000000        0.000000   \n",
       "..      ...             ...        ...             ...             ...   \n",
       "155  sub156  20200306000927      32559        0.000000        0.033754   \n",
       "156  sub157  20201009003102      18150        0.000000        0.000000   \n",
       "157  sub158  20200410001952      27969        0.002682        0.937359   \n",
       "158  sub159  20200218000582      53154        0.000000        0.000000   \n",
       "159  sub160  20200821002584      49019        0.000000        0.907505   \n",
       "\n",
       "     HM_PCA_R_Ratio  HM_Pons_Medulla_R_Ratio  HM_Cerebellum_R_Ratio  \\\n",
       "0          0.120148                 0.000000                    0.0   \n",
       "1          0.302316                 0.000000                    0.0   \n",
       "2          0.099681                 0.000197                    0.0   \n",
       "3          0.029100                 0.000374                    0.0   \n",
       "4          0.001146                 0.000337                    0.0   \n",
       "..              ...                      ...                    ...   \n",
       "155        0.000000                 0.000000                    0.0   \n",
       "156        0.000000                 0.000000                    0.0   \n",
       "157        0.059959                 0.000000                    0.0   \n",
       "158        0.000000                 0.000000                    0.0   \n",
       "159        0.092372                 0.000000                    0.0   \n",
       "\n",
       "     HM_ACA_L_Ratio  HM_MCA_L_Ratio  ...  ED_ACA_R_Ratio.8  ED_MCA_R_Ratio.8  \\\n",
       "0          0.000000        0.000000  ...               NaN               NaN   \n",
       "1          0.003032        0.000000  ...               NaN               NaN   \n",
       "2          0.000000        0.000000  ...               NaN               NaN   \n",
       "3          0.163458        0.313618  ...               NaN               NaN   \n",
       "4          0.000202        0.413363  ...               NaN               NaN   \n",
       "..              ...             ...  ...               ...               ...   \n",
       "155        0.038545        0.922049  ...               NaN               NaN   \n",
       "156        0.000000        0.997410  ...               NaN               NaN   \n",
       "157        0.000000        0.000000  ...               NaN               NaN   \n",
       "158        0.004572        0.857678  ...               NaN               NaN   \n",
       "159        0.000000        0.000000  ...               NaN               NaN   \n",
       "\n",
       "     ED_PCA_R_Ratio.8  ED_Pons_Medulla_R_Ratio.8  ED_Cerebellum_R_Ratio.8  \\\n",
       "0                 NaN                        NaN                      NaN   \n",
       "1                 NaN                        NaN                      NaN   \n",
       "2                 NaN                        NaN                      NaN   \n",
       "3                 NaN                        NaN                      NaN   \n",
       "4                 NaN                        NaN                      NaN   \n",
       "..                ...                        ...                      ...   \n",
       "155               NaN                        NaN                      NaN   \n",
       "156               NaN                        NaN                      NaN   \n",
       "157               NaN                        NaN                      NaN   \n",
       "158               NaN                        NaN                      NaN   \n",
       "159               NaN                        NaN                      NaN   \n",
       "\n",
       "     ED_ACA_L_Ratio.8  ED_MCA_L_Ratio.8  ED_PCA_L_Ratio.8  \\\n",
       "0                 NaN               NaN               NaN   \n",
       "1                 NaN               NaN               NaN   \n",
       "2                 NaN               NaN               NaN   \n",
       "3                 NaN               NaN               NaN   \n",
       "4                 NaN               NaN               NaN   \n",
       "..                ...               ...               ...   \n",
       "155               NaN               NaN               NaN   \n",
       "156               NaN               NaN               NaN   \n",
       "157               NaN               NaN               NaN   \n",
       "158               NaN               NaN               NaN   \n",
       "159               NaN               NaN               NaN   \n",
       "\n",
       "     ED_Pons_Medulla_L_Ratio.8  ED_Cerebellum_L_Ratio.8  \n",
       "0                          NaN                      NaN  \n",
       "1                          NaN                      NaN  \n",
       "2                          NaN                      NaN  \n",
       "3                          NaN                      NaN  \n",
       "4                          NaN                      NaN  \n",
       "..                         ...                      ...  \n",
       "155                        NaN                      NaN  \n",
       "156                        NaN                      NaN  \n",
       "157                        NaN                      NaN  \n",
       "158                        NaN                      NaN  \n",
       "159                        NaN                      NaN  \n",
       "\n",
       "[160 rows x 208 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_data[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, '入院首次检查流水号')"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_data = temp_data[-1]\n",
    "test_data[test_data == 20161212002136].stack().index[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "table2_columns = temp_data[1].columns\n",
    "HM = []\n",
    "ED = []\n",
    "other = []\n",
    "for i in table2_columns:\n",
    "    if i.startswith('Unnamed'):\n",
    "        table2_columns = table2_columns.drop(i)\n",
    "    elif i.startswith('HM'):\n",
    "        HM.append(i)\n",
    "    elif i.startswith('ED'):\n",
    "        ED.append(i)\n",
    "    else:\n",
    "        other.append(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['ID',\n",
       " '首次检查流水号',\n",
       " '随访1流水号',\n",
       " '随访2流水号',\n",
       " '随访3流水号',\n",
       " '随访4流水号',\n",
       " '随访5流水号',\n",
       " '随访6流水号',\n",
       " '随访7流水号',\n",
       " '随访8流水号']"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "other"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "576"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(temp_data[2]['流水号'].unique())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "首次检查流水号\n",
      "随访1流水号\n",
      "随访2流水号\n",
      "随访3流水号\n",
      "随访4流水号\n",
      "随访5流水号\n",
      "随访6流水号\n",
      "随访7流水号\n",
      "随访8流水号\n"
     ]
    }
   ],
   "source": [
    "for i in temp_data[1].columns:\n",
    "    if '流水' in i:\n",
    "        print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "deal_data = pd.read_excel(r'E:\\\23研赛\\建模2023\\建模2023\\2023年中国研究生数学建模竞赛赛题\\E题\\E题\\数据\\竞赛发布数据\\表2-患者影像信息血肿及水肿的体积及位置.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "table2_columns = deal_data.columns\n",
    "HM = []\n",
    "ED = []\n",
    "other = []\n",
    "for i in table2_columns:\n",
    "    if i.startswith('Unnamed'):\n",
    "        table2_columns = table2_columns.drop(i)\n",
    "    elif i.startswith('HM'):\n",
    "        HM.append(i)\n",
    "    elif i.startswith('ED'):\n",
    "        ED.append(i)\n",
    "    else:\n",
    "        other.append(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>首次检查流水号</th>\n",
       "      <th>HM_volume</th>\n",
       "      <th>HM_ACA_R_Ratio</th>\n",
       "      <th>HM_MCA_R_Ratio</th>\n",
       "      <th>HM_PCA_R_Ratio</th>\n",
       "      <th>HM_Pons_Medulla_R_Ratio</th>\n",
       "      <th>HM_Cerebellum_R_Ratio</th>\n",
       "      <th>HM_ACA_L_Ratio</th>\n",
       "      <th>HM_MCA_L_Ratio</th>\n",
       "      <th>...</th>\n",
       "      <th>ED_ACA_R_Ratio</th>\n",
       "      <th>ED_MCA_R_Ratio</th>\n",
       "      <th>ED_PCA_R_Ratio</th>\n",
       "      <th>ED_Pons_Medulla_R_Ratio</th>\n",
       "      <th>ED_Cerebellum_R_Ratio</th>\n",
       "      <th>ED_ACA_L_Ratio</th>\n",
       "      <th>ED_MCA_L_Ratio</th>\n",
       "      <th>ED_PCA_L_Ratio</th>\n",
       "      <th>ED_Pons_Medulla_L_Ratio</th>\n",
       "      <th>ED_Cerebellum_L_Ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161212002136</td>\n",
       "      <td>69714</td>\n",
       "      <td>0.000258</td>\n",
       "      <td>0.877112</td>\n",
       "      <td>0.120148</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.108833</td>\n",
       "      <td>0.726241</td>\n",
       "      <td>0.136511</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161218000100.0</td>\n",
       "      <td>70952.0</td>\n",
       "      <td>0.00155</td>\n",
       "      <td>0.817059</td>\n",
       "      <td>0.165718</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.144054</td>\n",
       "      <td>0.681799</td>\n",
       "      <td>0.149608</td>\n",
       "      <td>0.005285</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161223001020.0</td>\n",
       "      <td>62831.0</td>\n",
       "      <td>0.004663</td>\n",
       "      <td>0.803505</td>\n",
       "      <td>0.177158</td>\n",
       "      <td>0.000048</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.208223</td>\n",
       "      <td>0.599</td>\n",
       "      <td>0.141892</td>\n",
       "      <td>0.015576</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161230000574.0</td>\n",
       "      <td>44029.0</td>\n",
       "      <td>0.000341</td>\n",
       "      <td>0.835563</td>\n",
       "      <td>0.154784</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.166564</td>\n",
       "      <td>0.669171</td>\n",
       "      <td>0.127009</td>\n",
       "      <td>0.015203</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000016</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161213000009.0</td>\n",
       "      <td>74902.0</td>\n",
       "      <td>0.00036</td>\n",
       "      <td>0.869683</td>\n",
       "      <td>0.126018</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.099554</td>\n",
       "      <td>0.782998</td>\n",
       "      <td>0.093406</td>\n",
       "      <td>0.000259</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>sub158</td>\n",
       "      <td>20200413001806.0</td>\n",
       "      <td>24119.0</td>\n",
       "      <td>0.003317</td>\n",
       "      <td>0.905261</td>\n",
       "      <td>0.09138</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.021716</td>\n",
       "      <td>0.810139</td>\n",
       "      <td>0.140757</td>\n",
       "      <td>0.003517</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>sub159</td>\n",
       "      <td>20200219000588.0</td>\n",
       "      <td>126642.0</td>\n",
       "      <td>0.004967</td>\n",
       "      <td>0.000174</td>\n",
       "      <td>0.003774</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.086038</td>\n",
       "      <td>0.743292</td>\n",
       "      <td>...</td>\n",
       "      <td>0.003312</td>\n",
       "      <td>0.001735</td>\n",
       "      <td>0.022767</td>\n",
       "      <td>0.005153</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.278195</td>\n",
       "      <td>0.286345</td>\n",
       "      <td>0.240602</td>\n",
       "      <td>0.025028</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>sub159</td>\n",
       "      <td>20200218000582</td>\n",
       "      <td>53154</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.004572</td>\n",
       "      <td>0.857678</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.147678</td>\n",
       "      <td>0.711019</td>\n",
       "      <td>0.12474</td>\n",
       "      <td>0.008247</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>591</th>\n",
       "      <td>sub160</td>\n",
       "      <td>20200822000947.0</td>\n",
       "      <td>100470.0</td>\n",
       "      <td>0.031064</td>\n",
       "      <td>0.827919</td>\n",
       "      <td>0.119339</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.39682</td>\n",
       "      <td>0.411951</td>\n",
       "      <td>0.179479</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>sub160</td>\n",
       "      <td>20200821002584</td>\n",
       "      <td>49019</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.907505</td>\n",
       "      <td>0.092372</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.231984</td>\n",
       "      <td>0.679948</td>\n",
       "      <td>0.066373</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>593 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         ID           首次检查流水号 HM_volume HM_ACA_R_Ratio HM_MCA_R_Ratio  \\\n",
       "0    sub001    20161212002136     69714       0.000258       0.877112   \n",
       "1    sub001  20161218000100.0   70952.0        0.00155       0.817059   \n",
       "2    sub001  20161223001020.0   62831.0       0.004663       0.803505   \n",
       "3    sub001  20161230000574.0   44029.0       0.000341       0.835563   \n",
       "4    sub001  20161213000009.0   74902.0        0.00036       0.869683   \n",
       "..      ...               ...       ...            ...            ...   \n",
       "588  sub158  20200413001806.0   24119.0       0.003317       0.905261   \n",
       "589  sub159  20200219000588.0  126642.0       0.004967       0.000174   \n",
       "590  sub159    20200218000582     53154            0.0            0.0   \n",
       "591  sub160  20200822000947.0  100470.0       0.031064       0.827919   \n",
       "592  sub160    20200821002584     49019            0.0       0.907505   \n",
       "\n",
       "    HM_PCA_R_Ratio HM_Pons_Medulla_R_Ratio HM_Cerebellum_R_Ratio  \\\n",
       "0         0.120148                     0.0                   0.0   \n",
       "1         0.165718                     0.0                   0.0   \n",
       "2         0.177158                0.000048                   0.0   \n",
       "3         0.154784                     0.0                   0.0   \n",
       "4         0.126018                     0.0                   0.0   \n",
       "..             ...                     ...                   ...   \n",
       "588        0.09138                     0.0                   0.0   \n",
       "589       0.003774                     0.0                   0.0   \n",
       "590            0.0                     0.0                   0.0   \n",
       "591       0.119339                     0.0                   0.0   \n",
       "592       0.092372                     0.0                   0.0   \n",
       "\n",
       "    HM_ACA_L_Ratio HM_MCA_L_Ratio  ... ED_ACA_R_Ratio ED_MCA_R_Ratio  \\\n",
       "0              0.0            0.0  ...       0.108833       0.726241   \n",
       "1              0.0            0.0  ...       0.144054       0.681799   \n",
       "2              0.0            0.0  ...       0.208223          0.599   \n",
       "3              0.0            0.0  ...       0.166564       0.669171   \n",
       "4              0.0            0.0  ...       0.099554       0.782998   \n",
       "..             ...            ...  ...            ...            ...   \n",
       "588            0.0            0.0  ...       0.021716       0.810139   \n",
       "589       0.086038       0.743292  ...       0.003312       0.001735   \n",
       "590       0.004572       0.857678  ...            0.0            0.0   \n",
       "591            0.0            0.0  ...        0.39682       0.411951   \n",
       "592            0.0            0.0  ...       0.231984       0.679948   \n",
       "\n",
       "    ED_PCA_R_Ratio ED_Pons_Medulla_R_Ratio ED_Cerebellum_R_Ratio  \\\n",
       "0         0.136511                     0.0                   0.0   \n",
       "1         0.149608                0.005285                   0.0   \n",
       "2         0.141892                0.015576                   0.0   \n",
       "3         0.127009                0.015203                   0.0   \n",
       "4         0.093406                0.000259                   0.0   \n",
       "..             ...                     ...                   ...   \n",
       "588       0.140757                0.003517                   0.0   \n",
       "589       0.022767                0.005153                   0.0   \n",
       "590            0.0                     0.0                   0.0   \n",
       "591       0.179479                     0.0                   0.0   \n",
       "592       0.066373                     0.0                   0.0   \n",
       "\n",
       "    ED_ACA_L_Ratio ED_MCA_L_Ratio ED_PCA_L_Ratio ED_Pons_Medulla_L_Ratio  \\\n",
       "0              0.0            0.0            0.0                     0.0   \n",
       "1              0.0            0.0            0.0                     0.0   \n",
       "2              0.0            0.0            0.0                     0.0   \n",
       "3              0.0            0.0       0.000016                     0.0   \n",
       "4              0.0            0.0            0.0                     0.0   \n",
       "..             ...            ...            ...                     ...   \n",
       "588            0.0            0.0            0.0                     0.0   \n",
       "589       0.278195       0.286345       0.240602                0.025028   \n",
       "590       0.147678       0.711019        0.12474                0.008247   \n",
       "591            0.0            0.0            0.0                     0.0   \n",
       "592            0.0            0.0            0.0                     0.0   \n",
       "\n",
       "    ED_Cerebellum_L_Ratio  \n",
       "0                     0.0  \n",
       "1                     0.0  \n",
       "2                     0.0  \n",
       "3                     0.0  \n",
       "4                     0.0  \n",
       "..                    ...  \n",
       "588                   0.0  \n",
       "589                   0.0  \n",
       "590                   0.0  \n",
       "591                   0.0  \n",
       "592                   0.0  \n",
       "\n",
       "[593 rows x 24 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_skip = 23\n",
    "concat_data = pd.DataFrame(columns=deal_data.columns[:24])\n",
    "for i in range(9):\n",
    "    temp_data = deal_data.iloc[:, [0] + list(range(i * data_skip + 1, i * data_skip + 24))].values\n",
    "    concat_data = pd.concat([concat_data, pd.DataFrame(temp_data, columns=deal_data.columns[:24])], axis=0)\n",
    "concat_data = concat_data.reset_index(drop=True)\n",
    "concat_data.dropna(axis=0, how='any', inplace=True)\n",
    "concat_data.sort_values(by='ID', inplace=True)\n",
    "concat_data.reset_index(drop=True, inplace=True)\n",
    "concat_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, '入院首次检查流水号')"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date_data = pd.read_excel(r'E:\\\23研赛\\建模2023\\建模2023\\2023年中国研究生数学建模竞赛赛题\\E题\\E题\\数据\\竞赛发布数据\\附表1-检索表格-流水号vs时间.xlsx')\n",
    "date_data[date_data == 20161212002136].stack().index[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'入院首次检查流水号'"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date_col = date_data.columns\n",
    "index_date = date_data[date_data == 20161212002136].stack().index[0]\n",
    "index_date[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "index_name = index_date[1]\n",
    "temp_index = date_col.get_loc(index_name)\n",
    "temp_index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "current_time = []\n",
    "for liushui in concat_data['首次检查流水号']:\n",
    "    temp_index = date_data[date_data == liushui].stack().index[0]\n",
    "    time_index = date_col.get_loc(temp_index[1]) - 1\n",
    "    current_time.append(date_data.iloc[temp_index[0], time_index])\n",
    "concat_data['检查时间'] = current_time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "concat_data['检查时间'] = pd.to_datetime(concat_data['检查时间'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "concat_data.to_excel('处理后的表2.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "concat_data.sort_values(by=['ID','检查时间'], inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = concat_data.groupby('ID').count().iloc[:,0].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=int64)"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.unique(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "name, count = np.unique(concat_data['ID'].values, return_counts=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['sub101', 'sub102', 'sub103', 'sub104', 'sub105', 'sub106',\n",
       "       'sub107', 'sub108', 'sub109', 'sub110', 'sub111', 'sub112',\n",
       "       'sub113', 'sub114', 'sub115', 'sub116', 'sub117', 'sub118',\n",
       "       'sub119', 'sub120', 'sub121', 'sub122', 'sub123', 'sub124',\n",
       "       'sub125', 'sub126', 'sub127', 'sub128', 'sub129', 'sub130'],\n",
       "      dtype=object)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name[count == 1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "concat_data.to_excel('处理后的表2.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>首次检查流水号</th>\n",
       "      <th>HM_volume</th>\n",
       "      <th>HM_ACA_R_Ratio</th>\n",
       "      <th>HM_MCA_R_Ratio</th>\n",
       "      <th>HM_PCA_R_Ratio</th>\n",
       "      <th>HM_Pons_Medulla_R_Ratio</th>\n",
       "      <th>HM_Cerebellum_R_Ratio</th>\n",
       "      <th>HM_ACA_L_Ratio</th>\n",
       "      <th>HM_MCA_L_Ratio</th>\n",
       "      <th>...</th>\n",
       "      <th>ED_MCA_R_Ratio</th>\n",
       "      <th>ED_PCA_R_Ratio</th>\n",
       "      <th>ED_Pons_Medulla_R_Ratio</th>\n",
       "      <th>ED_Cerebellum_R_Ratio</th>\n",
       "      <th>ED_ACA_L_Ratio</th>\n",
       "      <th>ED_MCA_L_Ratio</th>\n",
       "      <th>ED_PCA_L_Ratio</th>\n",
       "      <th>ED_Pons_Medulla_L_Ratio</th>\n",
       "      <th>ED_Cerebellum_L_Ratio</th>\n",
       "      <th>检查时间</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161212002136</td>\n",
       "      <td>69714</td>\n",
       "      <td>0.000258</td>\n",
       "      <td>0.877112</td>\n",
       "      <td>0.120148</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.726241</td>\n",
       "      <td>0.136511</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2016-12-12 23:32:54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161213000009.0</td>\n",
       "      <td>74902.0</td>\n",
       "      <td>0.00036</td>\n",
       "      <td>0.869683</td>\n",
       "      <td>0.126018</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.782998</td>\n",
       "      <td>0.093406</td>\n",
       "      <td>0.000259</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2016-12-13 05:19:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161218000100.0</td>\n",
       "      <td>70952.0</td>\n",
       "      <td>0.00155</td>\n",
       "      <td>0.817059</td>\n",
       "      <td>0.165718</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.681799</td>\n",
       "      <td>0.149608</td>\n",
       "      <td>0.005285</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2016-12-18 09:09:24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161223001020.0</td>\n",
       "      <td>62831.0</td>\n",
       "      <td>0.004663</td>\n",
       "      <td>0.803505</td>\n",
       "      <td>0.177158</td>\n",
       "      <td>0.000048</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.599</td>\n",
       "      <td>0.141892</td>\n",
       "      <td>0.015576</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2016-12-23 16:47:09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>sub001</td>\n",
       "      <td>20161230000574.0</td>\n",
       "      <td>44029.0</td>\n",
       "      <td>0.000341</td>\n",
       "      <td>0.835563</td>\n",
       "      <td>0.154784</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.669171</td>\n",
       "      <td>0.127009</td>\n",
       "      <td>0.015203</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000016</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2016-12-30 14:35:12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>586</th>\n",
       "      <td>sub158</td>\n",
       "      <td>20200423000871.0</td>\n",
       "      <td>3647.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.957499</td>\n",
       "      <td>0.042501</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.820977</td>\n",
       "      <td>0.102937</td>\n",
       "      <td>0.001634</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2020-04-23 11:31:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>sub159</td>\n",
       "      <td>20200218000582</td>\n",
       "      <td>53154</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.004572</td>\n",
       "      <td>0.857678</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.147678</td>\n",
       "      <td>0.711019</td>\n",
       "      <td>0.12474</td>\n",
       "      <td>0.008247</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2020-02-18 15:29:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>sub159</td>\n",
       "      <td>20200219000588.0</td>\n",
       "      <td>126642.0</td>\n",
       "      <td>0.004967</td>\n",
       "      <td>0.000174</td>\n",
       "      <td>0.003774</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.086038</td>\n",
       "      <td>0.743292</td>\n",
       "      <td>...</td>\n",
       "      <td>0.001735</td>\n",
       "      <td>0.022767</td>\n",
       "      <td>0.005153</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.278195</td>\n",
       "      <td>0.286345</td>\n",
       "      <td>0.240602</td>\n",
       "      <td>0.025028</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2020-02-19 15:01:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>sub160</td>\n",
       "      <td>20200821002584</td>\n",
       "      <td>49019</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.907505</td>\n",
       "      <td>0.092372</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.679948</td>\n",
       "      <td>0.066373</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2020-08-21 22:32:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>591</th>\n",
       "      <td>sub160</td>\n",
       "      <td>20200822000947.0</td>\n",
       "      <td>100470.0</td>\n",
       "      <td>0.031064</td>\n",
       "      <td>0.827919</td>\n",
       "      <td>0.119339</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.411951</td>\n",
       "      <td>0.179479</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2020-08-22 12:01:00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>593 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         ID           首次检查流水号 HM_volume HM_ACA_R_Ratio HM_MCA_R_Ratio  \\\n",
       "0    sub001    20161212002136     69714       0.000258       0.877112   \n",
       "4    sub001  20161213000009.0   74902.0        0.00036       0.869683   \n",
       "1    sub001  20161218000100.0   70952.0        0.00155       0.817059   \n",
       "2    sub001  20161223001020.0   62831.0       0.004663       0.803505   \n",
       "3    sub001  20161230000574.0   44029.0       0.000341       0.835563   \n",
       "..      ...               ...       ...            ...            ...   \n",
       "586  sub158  20200423000871.0    3647.0            0.0       0.957499   \n",
       "590  sub159    20200218000582     53154            0.0            0.0   \n",
       "589  sub159  20200219000588.0  126642.0       0.004967       0.000174   \n",
       "592  sub160    20200821002584     49019            0.0       0.907505   \n",
       "591  sub160  20200822000947.0  100470.0       0.031064       0.827919   \n",
       "\n",
       "    HM_PCA_R_Ratio HM_Pons_Medulla_R_Ratio HM_Cerebellum_R_Ratio  \\\n",
       "0         0.120148                     0.0                   0.0   \n",
       "4         0.126018                     0.0                   0.0   \n",
       "1         0.165718                     0.0                   0.0   \n",
       "2         0.177158                0.000048                   0.0   \n",
       "3         0.154784                     0.0                   0.0   \n",
       "..             ...                     ...                   ...   \n",
       "586       0.042501                     0.0                   0.0   \n",
       "590            0.0                     0.0                   0.0   \n",
       "589       0.003774                     0.0                   0.0   \n",
       "592       0.092372                     0.0                   0.0   \n",
       "591       0.119339                     0.0                   0.0   \n",
       "\n",
       "    HM_ACA_L_Ratio HM_MCA_L_Ratio  ... ED_MCA_R_Ratio ED_PCA_R_Ratio  \\\n",
       "0              0.0            0.0  ...       0.726241       0.136511   \n",
       "4              0.0            0.0  ...       0.782998       0.093406   \n",
       "1              0.0            0.0  ...       0.681799       0.149608   \n",
       "2              0.0            0.0  ...          0.599       0.141892   \n",
       "3              0.0            0.0  ...       0.669171       0.127009   \n",
       "..             ...            ...  ...            ...            ...   \n",
       "586            0.0            0.0  ...       0.820977       0.102937   \n",
       "590       0.004572       0.857678  ...            0.0            0.0   \n",
       "589       0.086038       0.743292  ...       0.001735       0.022767   \n",
       "592            0.0            0.0  ...       0.679948       0.066373   \n",
       "591            0.0            0.0  ...       0.411951       0.179479   \n",
       "\n",
       "    ED_Pons_Medulla_R_Ratio ED_Cerebellum_R_Ratio ED_ACA_L_Ratio  \\\n",
       "0                       0.0                   0.0            0.0   \n",
       "4                  0.000259                   0.0            0.0   \n",
       "1                  0.005285                   0.0            0.0   \n",
       "2                  0.015576                   0.0            0.0   \n",
       "3                  0.015203                   0.0            0.0   \n",
       "..                      ...                   ...            ...   \n",
       "586                0.001634                   0.0            0.0   \n",
       "590                     0.0                   0.0       0.147678   \n",
       "589                0.005153                   0.0       0.278195   \n",
       "592                     0.0                   0.0            0.0   \n",
       "591                     0.0                   0.0            0.0   \n",
       "\n",
       "    ED_MCA_L_Ratio ED_PCA_L_Ratio ED_Pons_Medulla_L_Ratio  \\\n",
       "0              0.0            0.0                     0.0   \n",
       "4              0.0            0.0                     0.0   \n",
       "1              0.0            0.0                     0.0   \n",
       "2              0.0            0.0                     0.0   \n",
       "3              0.0       0.000016                     0.0   \n",
       "..             ...            ...                     ...   \n",
       "586            0.0            0.0                     0.0   \n",
       "590       0.711019        0.12474                0.008247   \n",
       "589       0.286345       0.240602                0.025028   \n",
       "592            0.0            0.0                     0.0   \n",
       "591            0.0            0.0                     0.0   \n",
       "\n",
       "    ED_Cerebellum_L_Ratio                检查时间  \n",
       "0                     0.0 2016-12-12 23:32:54  \n",
       "4                     0.0 2016-12-13 05:19:00  \n",
       "1                     0.0 2016-12-18 09:09:24  \n",
       "2                     0.0 2016-12-23 16:47:09  \n",
       "3                     0.0 2016-12-30 14:35:12  \n",
       "..                    ...                 ...  \n",
       "586                   0.0 2020-04-23 11:31:00  \n",
       "590                   0.0 2020-02-18 15:29:00  \n",
       "589                   0.0 2020-02-19 15:01:00  \n",
       "592                   0.0 2020-08-21 22:32:00  \n",
       "591                   0.0 2020-08-22 12:01:00  \n",
       "\n",
       "[593 rows x 25 columns]"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "concat_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
